/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package edu.chl.groupofdoom.beans;

import edu.chl.groupofdoom.entities.Torrent;
import edu.chl.groupofdoom.enums.Category;
import edu.chl.groupofdoom.jpa.Mapper;
import java.io.Serializable;
import java.util.List;
import javax.faces.bean.ManagedBean;
import javax.faces.bean.RequestScoped;

/**
 *
 * @author Seade
 */
@ManagedBean(name = "BrowseBean")
@RequestScoped
public class BrowseBean implements Serializable {

    Category category = Category.MOVIE;
    List<Torrent> result = Mapper.browseTorrents(category);

    public String changeCategory() {
        result = Mapper.browseTorrents(category);
        return "browse.jsf" + "?faces-redirect=true";
    }

    public List<Torrent> getResult() {
        return result;
    }

    public void setResult(List<Torrent> result) {
        this.result = result;
    }

    public Category getCategory() {
        return category;
    }

    public void setCategory(Category category) {
        this.category = category;
    }


    /** Creates a new instance of SearchBean */
    public BrowseBean() {


    }
}
